import Cookies from 'js-cookie'

const button = {
    state: {
        buttonList: Cookies.get('buttonCookies') ? JSON.parse(Cookies.get('buttonCookies')) : new Array()
    },
    mutations: {
        SET_BUTTON: (state, button) => {
            Cookies.set('buttonCookies', button);
            state.buttonList = button;
        }
    },
    actions: {
        setButtonList: ({ commit }, button) => {
            commit('SET_BUTTON', button);
        },
    }
};
export default button;
